package com.rms.recruit_management_system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rms.recruit_management_system.vo.InterviewVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface InterviewVoMapper extends BaseMapper<InterviewVo> {
    //联立面试表和用户表查询用户邮件，面试者姓名，职位名称
    @Select("select u.email,iv.candidate_name,iv.position_name from interview iv join user u on iv.user_id = u.user_id where iv.id = #{id}")
    InterviewVo selectEmail(Integer id);

    //联立面试表和反馈表根据面试id查询面试表中对应的反馈id,用户id
    @Select("select iv.id,iv.user_id,ife.feedback_id from interview iv left join interview_feedback ife on iv.id = ife.interview_id where iv.id = #{id}")
    InterviewVo selectInterviewVoById(Integer id);
}
